<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>Travian辅助</title>
	<meta name="keywords" content="淮阳网站建设|周口网站建设">
	<meta name="description" content="淮阳网站建设|周口网站建设">
    <meta content="telephone=no" name="format-detection">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="renderer" content="webkit"><!--双引擎浏览器默认webkit打开-->
	<meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no">
	<meta name="full-screen" content="yes">
	<link rel="stylesheet" href="__RES__/css/xcConfirm.css">
    <link rel="stylesheet" href="__RES__/css/uikit1.css">
    <script type="text/javascript" src="__RES__/js/jquery.js"></script>
    <script type="text/javascript" src="__RES__/js/xcConfirm.js"></script>
    <script type="text/javascript" src="__RES__/js/uikit.js"></script>
	
	<style>
	body{ padding:10px;}
	.active{color:#e4392a; border-bottom:3px solid #e4392a;}
	#my-id{ height:720px; line-height:1.8em;}
	#msg1,#msg1{ width:50%}
	#my-id li{word-wrap:break-word; word-break:normal; }
	.task{ width:600px; height:160px;}
	#bing1 .popBox{
    width: 570px;
    height: 500px;
    margin-left: -285px;
    margin-top: -250px;
	}
	#bing1 .popBox .txtBox{ height:280px;}
	.uk-modal .text{ width:50px;}
	.uk-modal .text1{ width:30px;}
	#bing2 .popBox{
    width: 570px;
    height: 500px;
    margin-left: -285px;
    margin-top: -250px;
	}
	#bing2 .popBox .txtBox{ height:300px;}
	#bing2 .text{ width:50px;}
	#bing2 .text1{ width:30px;}
	#bing2 .t{ letter-spacing:0.2em;}
	</style>
</head>
<body>
<div id="my-id1" class="uk-modal">
    <div class="uk-modal-dialog">
	<div class="uk-modal-header"><a class="uk-modal-close uk-close"></a></div>
        <form id="form1">
<div class="ttBox"><a class="clsBtn" id="clsBtn1"></a><span class="tt">添加抢夺目标</span></div><div class="txtBox">
<div class="uk-form-row">
<label class="uk-form-label" for="form-h-it">村庄：</label>
<div class="uk-form-controls">
<input type="text" id="form-h-it" placeholder="vid" class="text" name="vid" value="{$vid|default=''}">
</div>
<label class="uk-form-label" for="form-h-it">目标：</label>
<div class="uk-form-controls">
<input type="text" id="form-h-it" placeholder="X" class="text" name="form1_x"> <input type="text" id="form-h-it" placeholder="Y" class="text" name="form1_y">
</div>
<label class="uk-form-label" for="form-h-it">间隔：</label>
<div class="uk-form-controls">
<input type="text" id="form-h-it" placeholder="times" class="text" name="form1_s" value="600">
</div>
<label class="uk-form-label" for="form-h-it">兵种：</label>
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="font-size:10px; text-align:center; line-height:1.5em">
  <tr>
    <td>棒子<br>古罗<br>方阵</td>
    <td>矛兵<br>禁卫<br>剑士</td>
    <td>斧头<br>帝国<br>探路</td>
    <td>侦察<br>使节<br>雷法</td>
    <td>圣骑<br>帝骑<br>德鲁</td>
    <td>日骑<br>将军<br>海顿</td>
    <td>冲车</td>
    <td>投石</td>
    <td>忽悠</td>
    <td>拓荒</td>
    <td>英雄</td>
  </tr>
</table>
<div class="uk-form-controls">
<input type="text" id="form-h-it" placeholder="t1" class="text1" name="form1_t1">
<input type="text" id="form-h-it" placeholder="t2" class="text1" name="form1_t2">
<input type="text" id="form-h-it" placeholder="t3" class="text1" name="form1_t3">
<input type="text" id="form-h-it" placeholder="t4" class="text1" name="form1_t4">
<input type="text" id="form-h-it" placeholder="t5" class="text1" name="form1_t5">
<input type="text" id="form-h-it" placeholder="t6" class="text1" name="form1_t6">
<input type="text" id="form-h-it" placeholder="t7" class="text1" name="form1_t7">
<input type="text" id="form-h-it" placeholder="t8" class="text1" name="form1_t8">
<input type="text" id="form-h-it" placeholder="t9" class="text1" name="form1_t9">
<input type="text" id="form-h-it" placeholder="t10" class="text1" name="form1_t10">
<input type="text" id="form-h-it" placeholder="t11" class="text1" name="form1_t11">
</div>

<label class="uk-form-label" for="form-h-it">备注：</label>
<div class="uk-form-controls">
<input type="text" id="form-h-it" placeholder="note" name="form1_note" value="">
</div>

</div>
</div><div class="btnArea"><div class="btnGroup">
</div></div>
</form>
<div class="uk-modal-footer"><a id="bing_btn1" class="sgBtn ok">确定</a></div>
    </div>
</div>


<div id="my-id2" class="uk-modal">
    <div class="uk-modal-dialog">
	<div class="uk-modal-header"><a class="uk-modal-close uk-close"></a></div>
        <form id="form2">
<input type="hidden" name="id" value="">
<div class="ttBox"><a class="clsBtn" id="clsBtn2"></a><span class="tt">编辑抢夺目标</span></div><div class="txtBox">
<div class="uk-form-row">
<label class="uk-form-label" for="form-h-it">村庄：</label>
<div class="uk-form-controls">
<input type="text" id="form-h-it" placeholder="vid" name="vid">
</div>
<label class="uk-form-label" for="form-h-it">目标：</label>
<div class="uk-form-controls">
<input type="text" id="form-h-it" placeholder="X" class="text" name="x"> <input type="text" id="form-h-it" placeholder="Y" class="text" name="y">
</div>
<label class="uk-form-label" for="form-h-it">兵种：</label>
<div class="uk-form-controls">
<input type="text" id="form-h-it" placeholder="t" name="t" class="t">
</div>
<label class="uk-form-label" for="form-h-it">间隔：</label>
<div class="uk-form-controls">
<input type="text" id="form-h-it" placeholder="times" class="text" name="times">
</div>
<label class="uk-form-label" for="form-h-it">下次：</label>
<div class="uk-form-controls">
<input type="text" id="form-h-it" placeholder="start_time" name="start_time">
</div>
<label class="uk-form-label" for="form-h-it">状态：</label>
<div class="uk-form-controls">
<select name="status">
<option value='1'>开启</option>
<option value='0'>关闭</option>
</select>
</div>
<label class="uk-form-label" for="form-h-it">备注：</label>
<div class="uk-form-controls">
<input type="text" id="form-h-it" placeholder="note" name="note" value="">
</div>


</div>
</div><div class="btnArea"><div class="btnGroup">
</div></div>
</form>
<div class="uk-modal-footer"><a id="bing_btn" class="sgBtn ok">确定</a></div>
    </div>
</div>

<!--
<div class="xcConfirm" id="bing1">
<div class="xc_layer"></div><div class="popBox">
<form id="form1">
<div class="ttBox"><a class="clsBtn" id="clsBtn1"></a><span class="tt">添加抢夺目标</span></div><div class="txtBox">
<div class="uk-form-row">
<label class="uk-form-label" for="form-h-it">村庄：</label>
<div class="uk-form-controls">
<input type="text" id="form-h-it" placeholder="vid" class="text" name="vid" value="{$vid|default=''}">
</div>
<label class="uk-form-label" for="form-h-it">目标：</label>
<div class="uk-form-controls">
<input type="text" id="form-h-it" placeholder="X" class="text" name="form1_x"> <input type="text" id="form-h-it" placeholder="Y" class="text" name="form1_y">
</div>
<label class="uk-form-label" for="form-h-it">间隔：</label>
<div class="uk-form-controls">
<input type="text" id="form-h-it" placeholder="times" class="text" name="form1_s" value="600">
</div>
<label class="uk-form-label" for="form-h-it">兵种：</label>
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="font-size:10px; text-align:center; line-height:1.5em">
  <tr>
    <td>棒子<br>古罗<br>方阵</td>
    <td>矛兵<br>禁卫<br>剑士</td>
    <td>斧头<br>帝国<br>探路</td>
    <td>侦察<br>使节<br>雷法</td>
    <td>圣骑<br>帝骑<br>德鲁</td>
    <td>日骑<br>将军<br>海顿</td>
    <td>冲车</td>
    <td>投石</td>
    <td>忽悠</td>
    <td>拓荒</td>
    <td>英雄</td>
  </tr>
</table>
<div class="uk-form-controls">
<input type="text" id="form-h-it" placeholder="t1" class="text1" name="form1_t1">
<input type="text" id="form-h-it" placeholder="t2" class="text1" name="form1_t2">
<input type="text" id="form-h-it" placeholder="t3" class="text1" name="form1_t3">
<input type="text" id="form-h-it" placeholder="t4" class="text1" name="form1_t4">
<input type="text" id="form-h-it" placeholder="t5" class="text1" name="form1_t5">
<input type="text" id="form-h-it" placeholder="t6" class="text1" name="form1_t6">
<input type="text" id="form-h-it" placeholder="t7" class="text1" name="form1_t7">
<input type="text" id="form-h-it" placeholder="t8" class="text1" name="form1_t8">
<input type="text" id="form-h-it" placeholder="t9" class="text1" name="form1_t9">
<input type="text" id="form-h-it" placeholder="t10" class="text1" name="form1_t10">
<input type="text" id="form-h-it" placeholder="t11" class="text1" name="form1_t11">
</div>

<label class="uk-form-label" for="form-h-it">备注：</label>
<div class="uk-form-controls">
<input type="text" id="form-h-it" placeholder="note" name="form1_note" value="">
</div>

</div>
</div><div class="btnArea"><div class="btnGroup"><a id="bing_btn1" class="sgBtn ok">确定</a>
</div></div>
</form>
</div></div>


<div class="xcConfirm" id="bing2">
<div class="xc_layer"></div><div class="popBox">
<form id="form2">
<input type="hidden" name="id" value="">
<div class="ttBox"><a class="clsBtn" id="clsBtn2"></a><span class="tt">编辑抢夺目标</span></div><div class="txtBox">
<div class="uk-form-row">
<label class="uk-form-label" for="form-h-it">村庄：</label>
<div class="uk-form-controls">
<input type="text" id="form-h-it" placeholder="vid" name="vid">
</div>
<label class="uk-form-label" for="form-h-it">目标：</label>
<div class="uk-form-controls">
<input type="text" id="form-h-it" placeholder="X" class="text" name="x"> <input type="text" id="form-h-it" placeholder="Y" class="text" name="y">
</div>
<label class="uk-form-label" for="form-h-it">兵种：</label>
<div class="uk-form-controls">
<input type="text" id="form-h-it" placeholder="t" name="t" class="t">
</div>
<label class="uk-form-label" for="form-h-it">间隔：</label>
<div class="uk-form-controls">
<input type="text" id="form-h-it" placeholder="times" class="text" name="times">
</div>
<label class="uk-form-label" for="form-h-it">下次：</label>
<div class="uk-form-controls">
<input type="text" id="form-h-it" placeholder="start_time" name="start_time">
</div>
<label class="uk-form-label" for="form-h-it">状态：</label>
<div class="uk-form-controls">
<select name="status">
<option value='1'>开启</option>
<option value='0'>关闭</option>
</select>
</div>
<label class="uk-form-label" for="form-h-it">备注：</label>
<div class="uk-form-controls">
<input type="text" id="form-h-it" placeholder="note" name="note" value="">
</div>
-->

</div>
</div><div class="btnArea"><div class="btnGroup"><a id="bing_btn" class="sgBtn ok">确定</a>
</div></div>
</form>
</div></div>
<!--<button class="uk-button uk-button-primary" type="button" id="test2" >添加目标</button>-->
<button class="uk-button" data-uk-modal="{target:'#my-id1'}">添加目标</button>
村庄抢劫总开关：
<select name="attack_switch">
<option{if condition="$one_viliage['attack_switch'] == '1'" } selected{/if} value='1'>开启</option>
<option{if condition="$one_viliage['attack_switch'] == '0'" } selected{/if} value='0'>关闭</option>
</select>
<button class="uk-button uk-button-primary" type="button" id="save_switch" >保存</button>
<table class="uk-table">
                                    <caption>抢羊目标</caption>
                                    <thead>
                                        <tr>
                                            <th>坐标</th>
                                            <th>兵力</th>
                                            <th>村庄</th>
											<th>间隔</th>
											<th>下次</th>
											<th>状态</th>
											<th>备注</th>
											<th>操作</th>
                                        </tr>
                                    </thead>
                                    <tfoot>
                                        <tr>
                                            <td>坐标</td>
                                            <td>兵力</td>
                                            <td>村庄</td>
											<td>间隔</td>
											<td>下次</td>
											<td>状态</td>
											<td>备注</td>
											<td>操作</td>
                                        </tr>
                                    </tfoot>
                                    <tbody>
									{volist name="list" id="v"}
                                        <tr class="{}">
                                            <td>{$v.x} {$v.y}</td>
                                            <td style=" letter-spacing:0.2em;">{$v.t}</td>
                                            <td>{$v.vid}</td>
											<td>{$v.times}</td>
											<td>{$v.start_time} （{:date('m-d H:i:s',$v['start_time'])}）</td>
											<td>{$v.status}</td>
											<td>{$v.note}</td>
											<td><button class="uk-button" data-ac='edit' data-uk-modal="{target:'#my-id2'}" data-id="{$v.id}" data-x="{$v.x}" data-y="{$v.y}" data-vid="{$v.vid}" data-t="{$v.t}" data-times="{$v.times}" data-start_time="{$v.start_time}" data-status="{$v.status}" data-note="{$v.note}">编辑</button><!--<span data-ac="edit" data-id="{$v.id}" data-x="{$v.x}" data-y="{$v.y}" data-vid="{$v.vid}" data-t="{$v.t}" data-times="{$v.times}" data-start_time="{$v.start_time}" data-status="{$v.status}" data-note="{$v.note}">编辑</span>--> <span data-ac="del" data-id="{$v.id}">删除</span></td>
                                        </tr>
									{/volist}
                                    </tbody>
                                </table>
</body>
<script>
var uid = $('#userinfo').attr('data-uid');
var server = $("#userinfo").attr('data-server'); 
$('#bing1').hide();
$('#bing2').hide();

$('#clsBtn1').click(function(){
    $('#bing1').hide();
});

$('#clsBtn2').click(function(){
    $('#bing2').hide();
});




$('#test2').click(function(){
    $('#bing1').show();
});

$('#save_switch').click(function(){
	//var vid = $('#tab1 .uk-active a').text();
	var vid = $('[name="vid"]').val();
	var attack_switch = $('[name="attack_switch"]').val();
    $.ajax({
        url: "{:url('set_attack_switch')}/vid/"+vid+"/val/"+attack_switch,
        type: 'get',
        cache: false, 
		data: '',
        dataType: 'json',
        success: function(rs) {
		var str,a;
            if(rs == 'ok'){
			    str = '成功';
				a = 'uk-alert-success';
			}else{
			    str = '失败';
				a = 'uk-alert-danger';
			}
			var html = '<div class="uk-alert '+a+'" data-uk-alert id="alert"><a href="" class="uk-alert-close uk-close"></a><p>'+str+'</p></div>';
			$('body').prepend(html);
	    }
	});
});

$('#bing_btn1').click(function(){
	var btn = $(this);
	btn.attr("disabled", true);
	var obj = $("#form1").serialize();
	//var vid = $('#tab1 .uk-active a').text();
    $.ajax({
        url: "{:url('add_attack')}",
        type: 'post',
        cache: false, 
		data: obj,
        dataType: 'json',
        success: function(rs) {
            if(rs.a == 1){location.reload();}else{alert(rs.b);}
	    }
	});
});

$('[data-ac="del"]').click(function(){
    var obj = {};
	obj['id'] = $(this).attr('data-id');
	//var id = $(this).attr('data-id');
	var r=confirm("确定要删除吗？");
	if (r==true){
    $.ajax({
        url: "{:url('attack_del')}",
        type: 'get',
        cache: false, 
		data: obj,
        dataType: 'json',
        success: function(rs) {
			if(rs == 1){location.reload();}else{alert('删除失败');}
	    }
	});
	}
});

$('[data-ac="edit"]').click(function(){
    $('[name=id]').val($(this).attr('data-id'));
	$('[name=vid]').val($(this).attr('data-vid'));
	$('[name=x]').val($(this).attr('data-x'));
	$('[name=y]').val($(this).attr('data-y'));
	$('[name=t]').val($(this).attr('data-t'));
	$('[name=times]').val($(this).attr('data-times'));
	$('[name=start_time]').val($(this).attr('data-start_time'));
	$('[name=status]').val($(this).attr('data-status'));
	$('[name=note]').val($(this).attr('data-note'));
    //$('#bing2').show();
});

$('#bing_btn').click(function(){
    //var btn = $(this);
	//btn.attr("disabled", true);
	var obj = $("#form2").serialize();
	//var vid = $('#tab1 .uk-active a').text();
    $.ajax({
        url: "{:url('attack_edit')}",
        type: 'post',
        cache: false, 
		data: obj,
        dataType: 'json',
        success: function(rs) {
            if(rs == 1){location.reload();}else{alert('编辑失败');}
	    }
	});
});


</script>
</html>